// SPDX-License-Identifier: GPL-2.0
#include "ax_utils.h"


#include <linux/slab.h>
#include <linux/timer.h>
#include <linux/delay.h>

void *axvu_kzalloc(unsigned long size, unsigned int os_gfp_flag)
{

	if (os_gfp_flag == os_gfp_kernel)
		return kzalloc(size, GFP_KERNEL);
	else if (os_gfp_flag == os_gfp_atomic)
		return kzalloc(size, GFP_ATOMIC);
	else
		return NULL;
}

void *axvu_kmalloc(unsigned long size, unsigned int os_gfp_flag)
{
	if (os_gfp_flag == os_gfp_kernel)
		return kmalloc(size, GFP_KERNEL);
	else if (os_gfp_flag == os_gfp_atomic)
		return kmalloc(size, GFP_ATOMIC);
	else
		return NULL;
}

void axvu_kfree(const void *addr)
{
	kfree(addr);
}

void axvu_getjiffies(unsigned long long *pjiffies)
{
	*pjiffies = jiffies;
}

unsigned long axvu_msecs_to_jiffies(const unsigned int m)
{
	return msecs_to_jiffies(m);
}

void axvu_udelay(unsigned int usecs)
{
	udelay(usecs);
}

void axvu_mdelay(unsigned int msecs)
{
	mdelay(msecs);
}
